package service;

import android.os.RemoteException;
import java.util.ArrayList;
import java.util.List;

/**
 * 创建时间：2018年03月13日14:52 <br>
 * 作者：fuchaoyang <br>
 * 描述：aidl 接口的stub的实现
 */

public class MsgManagerImpl extends IMsgManager.Stub {
  private ICallBack callback;

  @Override public void getMsgInfo() throws RemoteException {
    // 异步获取数据，然后执行回调
    System.out.println("server start...");
    try {
      Thread.sleep(2000);
      callback.callback(new MsgInfo(1,"sync aidl"));
    } catch (InterruptedException e) {
      e.printStackTrace();
    }
  }

  @Override public void setCallback(ICallBack callback) throws RemoteException {
    this.callback = callback;
  }
}
